﻿@model HCQ2_Model.T_DocumentFolder
@{
    ViewBag.Title = "VR楼宇管理";
}
@section headerSection{
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/demo.css" rel="stylesheet" />
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/metroStyle/metroStyle.css" rel="stylesheet" />
    <script src="~/Lang/GetLangData"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.core.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.excheck.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.exedit.min.js"></script>
    <script src="~/Resources/tools/search_zTree.js"></script>
    <script src="~/Resources/tools/HRHelp.js"></script>
    <style>
        body {
            font-family: '微软雅黑';
            font-size: 14px;
            color: #676a6c;
        }

        .help-block {
            margin-top: 0;
        }

        a {
            font-size: 15px;
        }

        .float-unit {
            height: 100%;
            border: 1px solid #E7EAEC;
            border-top-width: 0px;
            border-bottom-width: 0px;
            margin-bottom: 0px;
        }

        .left-sm-3 {
            padding-left: 0px;
        }

        .right-sm-9 {
            padding-right: 0px;
        }

        .ibox-unit {
            overflow-y: auto;
            height: 89%;
            padding: 0px;
        }

        #exampleToolbar div {
            margin-bottom: 0px;
        }

        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-right: 5px;
            margin-top: 1px;
        }

        .form-group > button {
            margin-top: -2px;
            margin-bottom: 2px;
        }

        #unitTreezTreeData {
            border: 0;
            border-top: 1px solid #E7EAEC;
            background: #FFFFFF;
        }

        #unitTreezTreeData li {
            line-height: 28px;
        }

        #unitTreezTreeData li:hover {
            background: #F5F5F5;
        }

        #search_condition {
            width: 99%;
        }

        .selectTreezTreeLI {
            background-color: #2DC1C3;
            color: #fff;
        }

        #nodeFormTable label {
            font-weight: bold;
        }

        .fileClass label {
            text-align: right;
        }

        #upFileForm .col-sm-7 {
            margin-bottom: 8px;
        }

        #bootstrap-duallistbox-selected-list_duallistbox_demo1 option, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option {
            height: 30px;
            line-height: 30px;
            padding-top: 5px;
        }

        #bootstrap-duallistbox-selected-list_duallistbox_demo1 option:hover, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option:hover {
            background-color: antiquewhite;
        }

        .buttons {
            width: 100%;
        }

        .buttons button {
            width: 50%;
        }

        #folderTree {
            width: 400px;
            height: 300px;
            padding: 0;
            border: 1px solid #E7EAEC;
            background-color: #FFFFFF;
            position: fixed;
            z-index: 9;
            overflow: auto;
            display: none;
            bottom: 50px;
        }
        #_folder_tree, #parentTree {
            width: 400px;
            height: 300px;
            padding: 0;
            border: 1px solid #E7EAEC;
            background-color: #FFFFFF;
            position: fixed;
            z-index: 9;
            overflow: auto;
            display: none;
        }
        #clearParent {
            cursor: pointer;
        }
        #BatchEditFile .form-group {
            height: 25px;
        }
        #EditNode div {
            height: 25px;
        }
    </style>
}
<div class="wrapper animated fadeInRight autoHeight">
    <!-- Panel Other -->
    <div class="row autoHeight" style="background-color: #fff;">
        <!--选择类别-->
        <div id="unitTree" class="col-sm-3" style="width:220px;height:100%;padding:0;border:1px solid #E7EAEC;">
            @{
                List<string> folderList = (List<string>)ViewBag.elementList;
                if (folderList.Contains("docAddPeer"))
                {
                    <button id="docAddPeer" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.addRootNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddSysPeer"))
                {
                    <button id="docAddSysPeer" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.addSysRootNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddChild"))
                {
                    <button id="docAddChild" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.addChildNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list-alt" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddSysChild"))
                {
                    <button id="docAddSysChild" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.addSysChildNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list-alt" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docEdit"))
                {
                    <button id="docEdit" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.editNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docSysEdit"))
                {
                    <button id="docSysEdit" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.editSysNode")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docHeader"))
                {
                    <button id="docHeader" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.nodeIcon")" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-picture" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docDel"))
                {
                    <button id="docDel" type="button" title="@HCQ2_Common.LangHelper.GetValue("GeneralJson.deleteNode")" class="btn btn-outline btn-danger">
                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                    </button>
                }
            }
        </div>
        <div class="col-sm-9 col-sm-leftRight" style="width: calc(100% - 220px);padding-left: 3px; margin-top: 2px;">
            <!-- Example Toolbar -->
            <div class="example">
                <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                    @{
                        if (folderList.Contains("btnBuildingAdd"))
                        {
                            <button id="btnBuildingAdd" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true">添加</i>
                            </button>
                        }
                        if (folderList.Contains("btnBuildingDel"))
                        {
                            <button id="btnBuildingDel" type="button" class="btn btn-outline btn-danger">
                                <i class="glyphicon glyphicon-trash" aria-hidden="true">删除</i>
                            </button>
                        }
                        if (folderList.Contains("btnDevicePort"))
                        {
                            <button id="btnDevicePort" class="btn btn-outline btn-primary" type="button"><i class="fa fa-plus"></i>&nbsp;批量导入</button>
                        }
                        if (folderList.Contains("btnDeleteFile"))
                        {
                            <button id="btnDeleteFile" class="btn btn-outline btn-danger" type="button"><i class="fa fa-trash"></i>&nbsp;下架</button>
                        }
                        if (folderList.Contains("btnSearch"))
                        {
                            <div class="form-group" style="width:250px;">
                                <input id="keyword" name="keyword" type="text" class="form-control" placeholder="代码/名称/备注">
                            </div>
                            <div class="form-group" style="width:150px;margin-top:-2px;" title="@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.includeChild")">
                                <select id="inChild" class="form-control input-sm selectpicker" data-live-search="false" style="padding: 5px 10px;">
                                    <option value="no" selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.rootNotInclude")</option>
                                    <option value="yes">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.rootInclude")</option>
                                </select>
                            </div>
                            <div class="form-group" style="width:150px;margin-top:-2px;">
                                <select id="fileStatus" name="fileStatus" data-live-search="true" class="form-control input-sm selectpicker" placeholder="请选择状态">
                                    <option value="-1" selected>全部</option>
                                    <option value="4">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.removeSth")</option>
                                    <option value="5">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.hasBeenOn")</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;@HCQ2_Common.LangHelper.GetValue("GeneralJson.Query")</button>
                            </div>
                        }
                    }
                </div>
                <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true" style="table-layout: fixed !important;"></table>
                <div class="btn-group form-inline">
                    转移设备到
                    <div class="form-group" style="width:300px;margin-top:-3px;">
                        <input id="folderNames" name="folderNames" type="text" required="" aria-required="true" style="width:100%;" class="form-control input-sm" placeholder="请选择目录" />
                        <div id="folderTree" class="col-sm-3"></div>
                        <input id="folder_id" name="folder_id" type="hidden" />
                        <input id="folder_path" name="folder_path" type="hidden" />
                    </div>
                    <div class="form-group">
                        <button id="btnMove" class="btn btn-primary" type="button"><i class="fa fa-file-movie-o"></i>&nbsp;转移</button>
                    </div>
                </div>
            </div>
            <!-- End Example Toolbar -->
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!--添加/编辑普通节点-->
<div id="EditNode" class="form-group" style="height:90%;padding-top:20px;overflow: hidden; display: none;">
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.nodeName")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-7">
            <input id="addNode" name="addNode" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.nodeName")" required="" aria-required="true" />
            <!-- 是否私有-->
            <input type="hidden" id="if_private1" name="if_private1" value="1" />
            <!--是否需要权限验证-->
            <input type="hidden" id="if_limit1" name="if_limit1" value="1" />
        </div>
    </div>
    <div class="form-group" style="display:none;">
        <label class="col-sm-3 control-label">英文名称：</label>
        <div class="col-sm-7">
            <input id="enLangNode" name="enLangNode" type="text" class="form-control input-sm" placeholder="请输入英文名称" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.productCategory")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-7">
            <select id="proType1" name="proType1" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.productCategory")">
                @*<option value="1" selected="">VRPPT</option>
                    <option value="2">创客</option>
                    <option value="3">头记</option>
                    <option value="4">校史馆</option>*@
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ifShare")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-7">
            <select id="isShare" name="isShare" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ifShare")">
                <option value="0" selected="">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.notShare")</option>
                <option value="1">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allShare")</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.groupName")：</label>
        <div class="col-sm-7">
            <input id="group_name1" name="group_name1" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.groupName")" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.number")：</label>
        <div class="col-sm-7">
            <input id="folder_order1" name="folder_order1" type="text" onkeyup="help.int('folder_order1')" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.number")" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.onlyCode")：</label>
        <div class="col-sm-7">
            <span id="langCodeNode" name="langCodeNode" style="line-height:30px;"></span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">folder_path：</label>
        <div class="col-sm-7">
            <span id="folderPathNode" name="folderPathNode" style="line-height:30px;"></span>
        </div>
    </div>
</div>
<!-- 添加/编辑系统节点 -->
<div id="nodeForm" style="overflow-x: hidden;padding-bottom:100px; display: none;">
    <form class="form-horizontal m-t" id="nodeFormTable" method="post">
        <!-- 导航节点-->
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.parentFolder")：</label>
            <div class="col-sm-6">
                <input id="pName" name="pName" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.parentFolder")" /><label id="clearParent">清空</label>
                <div id="parentTree" class="col-sm-3"></div>
                <input id="pPath" name="pPath" type="hidden" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.nodeName")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <input id="name" name="name" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.nodeName")" required="" aria-required="true" />
                <input type="hidden" id="pId" name="pId" value="" />
                <input type="hidden" id="pageType" name="pageType" value="" />
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">英文名称：</label>
            <div class="col-sm-6">
                <input id="enLang" name="enLang" type="text" class="form-control input-sm" placeholder="请输入英文名称" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.productCategory")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="pro_type" name="pro_type" class="selectpicker show-tick bs-select-hidden" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.productCategory")">
                    @*<option value="1" selected>VRPPT</option>
                        <option value="2">创客</option>
                        <option value="3">头记</option>
                        <option value="4">校史馆</option>*@
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.selectRecommended")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="re_folder" name="re_folder" class="selectpicker show-tick bs-select-hidden" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.selectRecommended")">
                    <option value="0" selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.notRecommended")</option>
                    <option value="1">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.recommended")</option>
                </select>
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ifShare")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="is_share" name="is_share" class="selectpicker show-tick bs-select-hidden" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ifShare")">
                    <option value="0" selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.notShare")</option>
                    <option value="1">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allShare")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.belongUnit")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="unit_code" name="unit_code" class="selectpicker show-tick bs-select-hidden" data-live-search="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.belongUnit")">
                    <option value="" selected>@HCQ2_Common.LangHelper.GetValue("GeneralJson.isNull")</option>
                </select>
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.scope")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_private" name="if_private" class="selectpicker show-tick bs-select-hidden" data-live-search="true">
                    <option value=false selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.vrPublic")</option>
                    <option value=true>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.vrPrivate")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.whetherVerify")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_limit" name="if_limit" class="selectpicker show-tick bs-select-hidden" data-live-search="true" placeholder="@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.whetherVerify")">
                    <option value=true>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.verify")</option>
                    <option value=false selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.unverify")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.groupName")：</label>
            <div class="col-sm-6">
                <input id="group_name" name="group_name" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.groupName")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.number")：</label>
            <div class="col-sm-6">
                <input id="folder_order" name="folder_order" type="text" onkeyup="help.int('folder_order')" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.number")" />
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.shareThisPage")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="was_share" name="was_share" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.shareThisPage")" style="padding: 5px 10px;">
                    <option value=false selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.unallowed")</option>
                    <option value=true>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allow")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allowCatalog")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_create_child" name="if_create_child" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allowCatalog")" style="padding: 5px 10px;">
                    <option value=true selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allow")</option>
                    <option value=false>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.unallowed")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allowUserEdit")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="read_only" name="read_only" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allowUserEdit")" style="padding: 5px 10px;">
                    <option value=false selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.allow")</option>
                    <option value=true>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.unallowed")</option>
                </select>
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("GeneralJson.sysNode")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_sys" name="if_sys" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("GeneralJson.sysNode")" style="padding: 5px 10px;">
                    <option value=false>@HCQ2_Common.LangHelper.GetValue("GeneralJson.commonNode")</option>
                    <option value=true selected>@HCQ2_Common.LangHelper.GetValue("GeneralJson.sysNode")</option>
                </select>
            </div>
        </div>
        <div class="form-group" style="display:none;">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("GeneralJson.nodeType")<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="doc_type" name="doc_type" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("GeneralJson.nodeType")" style="padding: 5px 10px;">
                    <option value="0">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.myDocuments")</option>
                    <option value="1">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.myShare")</option>
                    <option value="2">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.shareDocuments")</option>
                    <option value="3" selected>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.publicDocuments")</option>
                    <option value="4">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.recycleBin")</option>
                    <option value="5">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.waitApprove")</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("GeneralJson.note")：</label>
            <div class="col-sm-6">
                <textarea class="form-control" id="folder_note" name="folder_note" rows="3" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("GeneralJson.note")"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.founderName")：</label>
            <div class="col-sm-6">
                <input id="founder_name" name="founder_name" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.founderName")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.gps_x")：</label>
            <div class="col-sm-6">
                <input id="gps_x" name="gps_x" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.gps_x")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.gps_y")：</label>
            <div class="col-sm-6">
                <input id="gps_y" name="gps_y" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.gps_y")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.bsType")：</label>
            <div class="col-sm-6">
                <input id="bs_type" name="bs_type" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.bsType")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.floorLevel")：</label>
            <div class="col-sm-6">
                <input id="floor_level" name="floor_level" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.floorLevel")" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.statrPartner")：</label>
            <div class="col-sm-6">
                <select id="statr_partner" name="statr_partner" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseSelect")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.statrPartner")" style="padding: 5px 10px;">
                    <option selected value=true>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.startPar")</option>
                    <option value=false>@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.closePar")</option>
                </select>
            </div>
        </div>
        <!--城市-->
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ddCity")：</label>
            <div class="col-sm-6">
                <input id="city" name="city" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ddCity")" />
            </div>
        </div>
        <!--地址-->
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ddAddr")：</label>
            <div class="col-sm-6">
                <input id="addr" name="addr" type="text" class="form-control input-sm" placeholder="@HCQ2_Common.LangHelper.GetValue("GeneralJson.pleaseImport")@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.ddAddr")" />
            </div>
        </div>
        <!-- 店铺下商品排序方式 -->
        <div class="form-group">
            <label class="col-sm-4 control-label">商品排序方式：</label>
            <div class="col-sm-6">
                <select id="sortType" name="sortType" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" style="padding: 5px 10px;">
                    <option selected value="3">修改时间降序</option>
                    <option value="4">创建时间降序</option>
                    <option value="5">序号降序</option>
                    <option value="6">序号升序</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.onlyCode")：</label>
            <div class="col-sm-6">
                <span id="langCode" name="langCode" style="line-height:30px;"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">folder_path：</label>
            <div class="col-sm-6">
                <span id="folderPath" name="folderPath" style="line-height:30px;"></span>
            </div>
        </div>
        <p style="color:red; padding-left:20px; padding-right:20px;display:none;">@HCQ2_Common.LangHelper.GetValue("VRGoodManager.VRCloudWork.vrNoteTip")</p>
    </form>
</div>
<!--  添加、编辑设备 -->
<div id="editDevice" class="form-group" style="padding-top:20px;overflow-x: hidden; display: none;">
    <form class="form-horizontal m-t" id="orgFormDeviceTable" method="post">
        <div class="form-group">
            <label class="col-sm-3 control-label">代码<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="file_code" name="file_code" type="text" class="form-control input-sm" placeholder="请输入设备代码" required="" aria-required="true" />
                <input type="hidden" id="file_id" name="file_id" />
                <input type="button" id="autoCode" onclick="deviceManager.autoCode()" value="生成代码" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="file_name" name="file_name" type="text" class="form-control input-sm" placeholder="请输入设备名称" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">别名<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="alias_name" name="alias_name" type="text" class="form-control input-sm" placeholder="请输入别名" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属目录<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7 form-inline">
                <div class="form-group" style="width:100%;margin-top:-3px;">
                    <input id="_folder_name" name="_folder_name" type="text" required="" aria-required="true" style="width:100%;margin-left:15px;" class="form-control input-sm" placeholder="请选择目录" />
                    <div id="_folder_tree" class="col-sm-3" style="margin-left:15px;"></div>
                    <input id="_folder_id" name="_folder_id" type="hidden" />
                    <input id="_folder_path" name="_folder_path" type="hidden" />
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">楼层：</label>
            <div class="col-sm-7">
                <input id="doc_number" name="doc_number" type="text" class="form-control input-sm" placeholder="请输入楼层" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">场景ID：</label>
            <div class="col-sm-7">
                <input id="programId" name="programId" type="text" onblur="help.bigint(this)" onkeyup="help.bigint(this)"  class="form-control input-sm" placeholder="请输入场景ID" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">价格：</label>
            <div class="col-sm-7">
                <input id="price" name="price" type="text" class="form-control input-sm price_money" placeholder="请输入价格" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">序号：</label>
            <div class="col-sm-7">
                <input id="file_order" name="file_order" type="text" class="form-control input-sm" placeholder="请输入序号" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-7">
                <textarea class="form-control" id="file_note" name="file_note" rows="3" placeholder="请输入备注信息" title="请输入备注信息"></textarea>
            </div>
        </div>
        <div class="form-group price">
            <label class="col-sm-3 control-label">最后修改时间：</label>
            <div class="col-sm-7">
                <input id="update_time" name="update_time" type="text" disabled class="form-control input-sm" placeholder="请输入序号" />
            </div>
        </div>
        <div class="form-group price">
            <label class="col-sm-3 control-label">最后修人：</label>
            <div class="col-sm-7">
                <input id="update_name" name="update_name" type="text" disabled class="form-control input-sm" placeholder="请输入序号" />
            </div>
        </div>
        <div class="form-group price">
            <label class="col-sm-3 control-label">创建时间：</label>
            <div class="col-sm-7">
                <input id="create_time" name="create_time" type="text" disabled class="form-control input-sm" placeholder="请输入序号" />
            </div>
        </div>
        <div class="form-group price">
            <label class="col-sm-3 control-label">创建人：</label>
            <div class="col-sm-7">
                <input id="create_name" name="create_name" type="text" disabled class="form-control input-sm" placeholder="请输入序号" />
            </div>
        </div>
    </form>
</div>

@section footSection{
    <script src="~/Resources/mainFrame/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <script src="~/Resources/x-editable/js/bootstrap-editable.js"></script>
    <script src="~/Resources/duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <script src="~/Resources/myScript/Doc/sourceManager.js"></script>
    <script>
        var userID = "@ViewBag.userID", isDocSys = "@ViewBag.isdocManager";//是否为管理员
        var isFolder = false, isFolderNum = false, parentFolder = false, unitzTrees, deviceTrees, parentzTrees;
        var pageType, doc_type, pro_type;
        var deviceManager = {
            initPage: function () {
                deviceManager.initData();
                deviceManager.initSelect();
                deviceManager.bindZtree();
                deviceManager.bindDeviceZtree();
                deviceManager.bindEvent();
            },
            //初始化参数
            initData:function(){
                 pageType = $.getUrls("pageType"),//VRBuilding
                 doc_type = $.getUrls("doc_type"),//3
                 pro_type = $.getUrls("pro_type");
                 if (!pageType)
                     pageType = "";
            },
            //绑定Table
            initTable: function () {
                options = {
                    url: ctx + "/VRBuilding/InitTable",
                    cutHeight: 50,
                    showRefresh: false,
                    showToggle: false,
                    showColumns: false,
                    singleSelect: false,//多选
                    uniqueId:'file_id',
                    toolbar: "#exampleToolbar",
                    queryParams: function (params) {
                        params = {
                            rows: params.limit,
                            //页面大小
                            page: params.offset / params.limit + 1,
                            folder_id: $folder_id,//节点ID
                            folder_path: $folder_path,
                            file_status: $('#fileStatus').val(),//状态
                            inChild: $('#inChild').val(),//是否包含子目录，空是包含
                            keyword: $('#keyword').val()//文档名
                        }
                        return params;
                    },
                    columns: [{
                        width: 60,
                        checkbox: true
                    }, {
                        field: '',
                        title: '操作',
                        align: 'center',
                        width: 140,
                        formatter: function (value, row, index) {
                            switch (doc_type) {
                                case "3": {
                                    var str = "<button class=\"btn btn-info btn-circle btn-outline\" title=\"入住日志\" onclick=\"deviceManager.openLogList(" + row.file_id + ",'"+row.file_code+"','"+row.file_name+"')\" type=\"button\"><i class=\"glyphicon glyphicon-th-large\"></i></button>&nbsp;";
                                    str += "<button class=\"btn btn-info btn-circle btn-outline\" title='编辑' onclick=\"deviceManager.getPriceList(" + row.file_id + ")\" type=\"button\"><i class=\"fa fa-pencil\"></i></button>";
                                    return str;
                                } break;
                                case "4": {
                                    //从下架中恢复
                                    return "<button class=\"btn btn-danger btn-circle btn-outline\" title=\"" + Lang.VRGoodManager.VRCloudWork.titleReset + "\" onclick=\"docManager.recoverDocEvent(" + row.file_id + ")\" type=\"button\"><i class=\"fa fa-mail-reply\"></i></button>";
                                } break;
                                default: return index + 1; break;
                            }
                        }
                    }, {
                        field: 'alias_name',//缩略图
                        title: '缩略图',
                        align: 'center',
                        width: 70,
                        formatter: function (value, row, index) {
                            return "<button title='" + Lang.VRGoodManager.VRCloudWork.thumbnail + "' onclick=docManager.openPicture(" + row.file_id + ") class='btn btn-primary btn-circle btn-outline'><i class=\"fa fa-picture-o\"></i></button>";
                        }
                    }, {
                        field: 'file_code',
                        title: '代码',
                        align: 'center',
                        width: 150,
                        formatter: function (value, row, index) {
                            var folderNum = (row.folder_num) ? row.folder_num : value;
                            if (folderNum && folderNum.toString().length > 15)
                                back = "<span title='" + folderNum + "'>" + folderNum.toString().substring(0, 15) + "...</span>";
                            else
                                back = folderNum;
                            return back;
                        }
                    }, {
                        field: 'file_name',
                        title: '名称',
                        align: 'left',
                        width: 110,
                        formatter: function (value, row, index) {
                            var back = "";
                            if (value && value.toString().length > 10)
                                back = "<span title='" + value + "'>" + value.toString().substring(0, 10) + "...</span>";
                            else
                                back = value;
                            return back;
                        }
                    }, {
                        field: 'doc_number',
                        title: '楼层',
                        align: 'center',
                        width: 50
                    }, {
                        field: 'price',
                        title: '价格',
                        align: 'center',
                        width: 50
                     }, {
                        field: 'file_order',
                        title: '序号',
                        align: 'center',
                        width: 40
                      }, {
                        field: 'user_name',
                        title: '入住人用户名',
                        align: 'center',
                        width: 100
                    }, {
                        field: 'user_phone',
                        title: '入住人手机号',
                        align: 'center',
                        width: 110
                    }, {
                        field: 'folder_name',
                        title: '所属目录',
                        align: 'center',
                        width: 150
                    }, {
                        field: 'file_note',
                        title: '备注',
                        align: 'center',
                        width: 100,
                        formatter: function (value, row, index) {
                            var back = "";
                            if (value && value.toString().length > 15)
                                back = "<span title='" + value + "'>" + value.toString().substring(0, 15) + "...</span>";
                            else
                                back = value;
                            return back;
                        }
                    }, {
                        field: 'update_time',
                        title: Lang.GeneralJson.updateTime,
                        width: 110,
                        align: 'center'
                    }, {
                        field: 'update_name',
                        title: '更新人',
                        width: 110,
                        align: 'center'
                    }, {
                        field: 'create_time',
                        title: '创建时间',
                        width: 110,
                        align: 'center'
                    }, {
                        field: 'create_name',
                        title: '创建人',
                        width: 110,
                        align: 'center'
                    }],
                    onClickRow: function (row, $element) {
                    },
                    onLoadSuccess: function (data) {
                        var val = "";
                        if (checkNodeSpan)
                            val = $('#' + checkNodeSpan).text();
                        if (data && data.total > 0 && checkNodeSpan) {
                            if (val.indexOf('(') > -1)
                                $('#' + checkNodeSpan).text(val.split('(')[0] + "(" + data.total + ")");
                            else
                                $('#' + checkNodeSpan).text(val + "(" + data.total + ")");
                        } else if (val.indexOf('(') > -1 && checkNodeSpan)
                            $('#' + checkNodeSpan).text(val.split('(')[0]);
                    }
                }
                $table = tableHelper.initTable("exampleTableToolbar", options);
            },
            //2.2采用Ztree初始化文档树
            bindZtree: function () {
                var setting = {
                    view: {
                        showIcon: true,
                        selectedMulti: false,
                        fontCss: getFontCss
                    },
                    edit: {
                        enable: true,
                        showRemoveBtn: false,
                        showRenameBtn: false
                    },
                    async: {
                        enable: true,
                        dataType: "text",
                        type: "post",
                        url: ctx + "/DocManager/GetDocTreeData?pro_type=" + pro_type + "&doc_type=" + doc_type + "&isNum=1&pageType=" + pageType,
                        autoParam: ["id"]
                    },
                    data: {
                        key: { title: "name", name: "name" },
                        simpleData: { enable: true, idKey: "id", pIdKey: "pId", rootPId: 0 }
                    },
                    check: {
                        enable: false,
                        autoCheckTrigger: true,
                        chkStyle: "checkbox",
                        chkboxType: { "Y": "p", "N": "ps" }
                    },
                    callback: {
                        onAsyncError: function () {
                            layer.msg(Lang.GeneralJson.unitErrorMessage, { icon: 5 });
                        },
                        onAsyncSuccess: function (event, treeId, treeNode, msg) {
                        },
                        onClick: function (event, treeId, treeNode) {
                            $('#folderTree a').css("color", "#333");
                            $('#' + treeNode.tId + '_a').css("color", "#ffffff");
                            $('#folder_id').val(treeNode.id);
                            $('#folder_path').val(treeNode.folder_path);
                            $('#folderTree').slideUp();
                            var folderName = treeNode.name;
                            if (folderName.indexOf('(') > -1)
                                $('#folderNames').val(folderName.substring(0, folderName.indexOf('(')));
                            else
                                $('#folderNames').val(folderName);
                            isFolder = false;
                        }
                    }
                };
                unitzTrees = $("#folderTree").initzTreeView(setting, 'ushow');
            },
            //2.3 绑定设备所属目录
            bindDeviceZtree: function () {
                var setting = {
                    view: {
                        showIcon: true,
                        selectedMulti: false,
                        fontCss: getFontCss
                    },
                    edit: {
                        enable: true,
                        showRemoveBtn: false,
                        showRenameBtn: false
                    },
                    async: {
                        enable: true,
                        dataType: "text",
                        type: "post",
                        url: ctx + "/DocManager/GetDocTreeData?pro_type=" + pro_type + "&doc_type=" + doc_type + "&isNum=1&pageType=" + pageType,
                        autoParam: ["id"]
                    },
                    data: {
                        key: { title: "name", name: "name" },
                        simpleData: { enable: true, idKey: "id", pIdKey: "pId", rootPId: 0 }
                    },
                    check: {
                        enable: false,
                        autoCheckTrigger: true,
                        chkStyle: "checkbox",
                        chkboxType: { "Y": "p", "N": "ps" }
                    },
                    callback: {
                        onAsyncError: function () {
                            layer.msg(Lang.GeneralJson.unitErrorMessage, { icon: 5 });
                        },
                        onAsyncSuccess: function (event, treeId, treeNode, msg) {
                        },
                        onClick: function (event, treeId, treeNode) {
                            $('#_folder_tree a').css("color", "#333");
                            $('#' + treeNode.tId + '_a').css("color", "#ffffff");
                            $('#_folder_id').val(treeNode.id);
                            $('#_folder_path').val(treeNode.folder_path);
                            $('#_folder_tree').slideUp();
                            var folderName = treeNode.name;
                            if (folderName.indexOf('(') > -1)
                                $('#_folder_name').val(folderName.substring(0, folderName.indexOf('(')));
                            else
                                $('#_folder_name').val(folderName);
                            isFolder = false;
                        }
                    }
                };
                deviceTrees = $("#_folder_tree").initzTreeView(setting, 'ushow');
            },
            //2.3修改父目录时Ztree初始化文档树
            bindParentZtree: function () {
                var pageType = $.getUrls("pageType"),
                    doc_type = $.getUrls("doc_type"),
                    pro_type = $.getUrls("pro_type");
                if (!pageType)
                    pageType = "";
                var setting = {
                    view: {
                        showIcon: true,
                        selectedMulti: false,
                        fontCss: getFontCss
                    },
                    edit: {
                        enable: true,
                        showRemoveBtn: false,
                        showRenameBtn: false
                    },
                    async: {
                        enable: true,
                        dataType: "text",
                        type: "post",
                        url: ctx + "/DocManager/GetDocTreeData?pro_type=" + pro_type + "&doc_type=" + doc_type + "&folder_path=" + $folder_path + "&isNum=1&pageType=" + pageType,
                        autoParam: ["id"]
                    },
                    data: {
                        key: { title: "name", name: "name" },
                        simpleData: { enable: true, idKey: "id", pIdKey: "pId", rootPId: 0 }
                    },
                    check: {
                        enable: false,
                        autoCheckTrigger: true,
                        chkStyle: "checkbox",
                        chkboxType: { "Y": "p", "N": "ps" }
                    },
                    callback: {
                        onAsyncError: function () {
                            layer.msg(Lang.GeneralJson.unitErrorMessage, { icon: 5 });
                        },
                        onAsyncSuccess: function (event, treeId, treeNode, msg) {
                        },
                        onClick: function (event, treeId, treeNode) {
                            $('#parentTree a').css("color", "#333");
                            $('#' + treeNode.tId + '_a').css("color", "#ffffff");
                            $('#pId').val(treeNode.id);
                            $('#pPath').val(treeNode.folder_path);
                            $('#parentTree').slideUp();
                            var folderName = treeNode.name;
                            if (folderName.indexOf('(') > -1)
                                $('#pName').val(folderName.substring(0, folderName.indexOf('(')));
                            else
                                $('#pName').val(folderName);
                            parentFolder = false;
                        }
                    }
                };
                parentzTrees = $("#parentTree").initzTreeView(setting, 'ushow');
            },
            bindEvent: function () {
                //楼宇转移查询
                $('#folderNames').on('click', function (event) {
                    if (!isFolder) {
                        //打开
                        $('#folderTree').slideDown();
                        isFolder = true;
                    } else {
                        //关闭
                        $('#folderTree').slideUp();
                        isFolder = false;
                    }
                    event.stopPropagation();
                });
                //添加、编辑楼宇目录
                $('#_folder_name').on('click', function (event) {
                    if (!isFolderNum) {
                        //打开
                        $('#_folder_tree').slideDown();
                        isFolderNum = true;
                    } else {
                        //关闭
                        $('#_folder_tree').slideUp();
                        isFolderNum = false;
                    }
                    event.stopPropagation();
                });
                //添加
                $('#btnBuildingAdd').on('click', function () {
                    $('.price').css("display", "none");
                    deviceManager.editDevice(null);
                });
                //删除设备
                $('#btnBuildingDel').on('click', function () {
                    var rows = docManager.selections(true);
                    if (!rows)
                        return false;
                    var $actData = new Array();
                    $.each(rows, function (index, item) {
                        $actData.push(item.file_id);
                    });
                    var $fileId = $actData.join(',');
                    layer.confirm('您确定要删除选中当前记录吗？', { btn: ['确定', '取消'] }, function () {
                        $.ajax({
                            type: 'post',
                            url: ctx + "/DocManager/DelNodeById",
                            dataType: 'json',
                            async: false,
                            data: { fileId: $fileId },
                            success: function (data) {
                                if (data.Statu === 0) {
                                    layer.msg(data.Msg);
                                    $table.bootstrapTable('refresh',options);
                                }
                                else
                                    layer.msg(data.Msg, { icon: 5 });
                            }
                        });
                    }, function () { });
                });
                //转移设备
                $('#btnMove').on('click', function () {
                    //1.0 判断是否选中记录
                    var row = $table.bootstrapTable('getSelections');
                    if (!row || row.length === 0) {
                        layer.msg("数据为空或未选中记录行~", { icon: 5 });
                        return false;
                    }
                    //2.0判断是否选中新目录
                    var folder_id = $('#folder_id').val(),
                          folder_path = $('#folder_path').val();
                    if (!folder_path) {
                        layer.msg("请选择需要转移到的目录~", { icon: 5 });
                        return false;
                    }
                    //选中记录
                    var $actData = new Array();
                    $.each(row, function (index, item) {
                        $actData.push(item.file_id);
                    });
                    var $fileId = $actData.join(',');
                    $.ajax({
                        type: 'post',
                        url: ctx + '/VRBuilding/SaveBatchData',
                        data: { "folder_id": folder_id, "folder_path": folder_path, "fileIds": $fileId },
                        dataType: 'json',
                        async: false,
                        success: function (data) {
                            if (data.Statu === 0) {
                                layer.msg("设备转移成功！", { icon: 6 });
                                $table.bootstrapTable('refresh', options);
                            }
                            else
                                layer.msg(data.Msg, { icon: 5 });
                        }
                    });
                });
                //修改父目录【左侧目录】
                $('#pName').on('click', function (event) {
                    if (parentzTrees)
                        parentzTrees.destroy();
                    deviceManager.bindParentZtree();//初始化修改父目录导航树
                    if (!parentFolder) {
                        //打开
                        $('#parentTree').slideDown();
                        parentFolder = true;
                    } else {
                        //关闭
                        $('#parentTree').slideUp();
                        parentFolder = false;
                    }
                    event.stopPropagation();
                });
            },
            //自动生成代码
            autoCode: function () {
                var code = (S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4());
                $('#file_code').val(code);
            },
            initSelect: function () {
                $('#pro_type').initSelectcontrol("vrProType");
                $('.files').prettyFile();
            },
            //添加、编辑设备
            editDevice: function (row, isDis) {
                var $title = "添加设备",
                    addOrEditUrl = ctx + "/VRBuilding/AddBuild";//新增
                if (row) {
                    $('.price').css("display", "block");
                    $title = "编辑设备";
                    addOrEditUrl = ctx + "/VRBuilding/EditBuild";//编辑
                }
                //清空表单
                $('#orgFormDeviceTable').resetHideValidForm();
                //打开编辑
                layer.open({
                    title: [$title, 'font-size:18px;'],
                    type: 1,
                    content: $('#editDevice'),
                    scroll: true,//是否显示滚动条、默认不显示
                    btn: ['确定', '取消'],
                    area: ['800px', '98%'],
                    success: function (li, o) {
                        if (row) {
                            $('#orgFormDeviceTable')[0].reset();//重置表单
                            $('#orgFormDeviceTable').LoadForm(row);//表单填充数据
                        }
                    },
                    yes: function (li, o) {
                        if (isDis) {
                            layer.closeAll();
                            return false;
                        }
                        if ($('#orgFormDeviceTable').valid()) {
                            //验证通过
                            $('#orgFormDeviceTable').ajaxSubmit({
                                url: addOrEditUrl,
                                type: "post",
                                dataType: "json",
                                beforeSubmit: function (arr, $form, options) {
                                    layer.msg("提交数据~", { icon: 1, time: 5000 });
                                },
                                success: function (result, status, xhr, $form) {
                                    if (result.Statu === 0) {
                                        layer.closeAll();
                                        $table.bootstrapTable('refresh');
                                        layer.msg('保存成功', { icon: 1 });
                                    }
                                    else
                                        layer.alert(result.Msg, { icon: 5 });
                                },
                                error: function (xhr, status, error, $form) {
                                    layer.msg("保存失败~", { icon: 5 });
                                }
                            });
                        }
                    },
                    cancel: function (li, o) {

                    }
                });
            },
            //日志
            openLogList: function (file_id, file_code,file_name) {
                let $title = `楼房代码：${file_code} 楼房名称：${file_name}`
                //打开日志
                layer.open({
                    title: [$title, 'font-size:18px;'],
                    type: 2,
                    content: ctx + '/SourceManager/VRBuildLogList?file_id=' + file_id,
                    scroll: true,//是否显示滚动条、默认不显示
                    btn: null,
                    area: ['90%', '98%'],
                    cancel: function (li, o) {

                    }
                });
            },
            //详细
            openDetial: function (file_id) {
                deviceManager.getPriceList(file_id,true);
            },
            //获取价格列表
            getPriceList: function (file_id, isDis) {
                var row = $table.bootstrapTable('getRowByUniqueId', file_id);
                if (!row || row.length === 0) {
                    layer.msg("数据为空或未选中记录行~", { icon: 5 });
                    return false;
                }
                row._folder_name = row.folder_name;
                row._folder_id = row.folder_id;
                row._folder_path = row.folder_path;
                deviceManager.editDevice(row, isDis);
            }
        }
        $(function () {
            deviceManager.initPage();
            //初始化页面
            docManager.initPage(userID, isDocSys);
            deviceManager.initTable();
        });
        function S4() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        };
    </script>
}